package mysql

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Mobile   string `gorm:"column:mobile;type:char(11);not null;unique;comment:手机号"`
	Password string `gorm:"column:password;type:varchar(100);not null;comment:密码"`
	Status   int    `gorm:"column:status;type:int;not null;comment:状态"`
}

// 查询用户
func GetUserByMobile(mobile string, password string) (u *User, db *gorm.DB) {
	db = DB
	db = db.Where("mobile = ? and password = ?", mobile, password).First(&u)
	return
}
